/**
 * futures : masterlink.futures.vo.Fuhivc.java
 */
package masterlink.futures.vo;

import java.io.Serializable;

import javax.persistence.Column;
import javax.persistence.Embeddable;
import javax.persistence.EmbeddedId;
import javax.persistence.Entity;

/**
 * 
 *
 * @author : tonyyang
 * Create date : 2011/10/27
 * @version 1.0.0	
 */
@Entity
public class GreekVerbS implements Serializable {

	private static final long serialVersionUID = -5613567214678821166L;
	@EmbeddedId
	private GreekVerbSPK id;
	@Column(name="SELL_MRKTPRICE")
	private Double sellMrktPrice=0d;
	@Column(name="BUY_MRKTPRICE")
	private Double buyMrktPrice=0d;
	@Column(name="FUT_BALANCE")
	private Double futBalance;
	
	/**
	 * @return the id
	 */
	public GreekVerbSPK getId() {
		return id;
	}

	/**
	 * @param id the id to set
	 */
	public void setId(GreekVerbSPK id) {
		this.id = id;
	}

	/**
	 * @return the sellMrktPrice
	 */
	public Double getSellMrktPrice() {
		return sellMrktPrice;
	}

	/**
	 * @param sellMrktPrice the sellMrktPrice to set
	 */
	public void setSellMrktPrice(Double sellMrktPrice) {
		this.sellMrktPrice = sellMrktPrice;
	}

	/**
	 * @return the buyMrktPrice
	 */
	public Double getBuyMrktPrice() {
		return buyMrktPrice;
	}

	/**
	 * @param buyMrktPrice the buyMrktPrice to set
	 */
	public void setBuyMrktPrice(Double buyMrktPrice) {
		this.buyMrktPrice = buyMrktPrice;
	}

	/**
	 * @return the futBalance
	 */
	public Double getFutBalance() {
		return futBalance;
	}

	/**
	 * @param futBalance the futBalance to set
	 */
	public void setFutBalance(Double futBalance) {
		this.futBalance = futBalance;
	}

	/* (non-Javadoc)
	 * @see java.lang.Object#hashCode()
	 */
	@Override
	public int hashCode() {
		final int prime = 31;
		int result = 1;
		result = prime * result + ((id == null) ? 0 : id.hashCode());
		return result;
	}

	/* (non-Javadoc)
	 * @see java.lang.Object#equals(java.lang.Object)
	 */
	@Override
	public boolean equals(Object obj) {
		if (this == obj)
			return true;
		if (obj == null)
			return false;
		if (!(obj instanceof GreekVerbS))
			return false;
		GreekVerbS other = (GreekVerbS) obj;
		if (id == null) {
			if (other.id != null)
				return false;
		} else if (!id.equals(other.id))
			return false;
		return true;
	}

	/* (non-Javadoc)
	 * @see java.lang.Object#toString()
	 */
	@Override
	public String toString() {
		StringBuilder builder = new StringBuilder();
		builder.append("GreekVerbS [id=");
		builder.append(id);
		builder.append(", sellMrktPrice=");
		builder.append(sellMrktPrice);
		builder.append(", buyMrktPrice=");
		builder.append(buyMrktPrice);
		builder.append(", futBalance=");
		builder.append(futBalance);
		builder.append("]");
		return builder.toString();
	}

	@Embeddable
	public static class GreekVerbSPK implements Serializable{

		private static final long serialVersionUID = 8477502550574696840L;
		@Column(name="account")
		private String account;
		@Column(name="BROKER")
		private String broker;
		@Column(name="SETMONTH")
		private String setMonth;
		/**
		 * @return the account
		 */
		public String getAccount() {
			return account;
		}
		/**
		 * @param account the account to set
		 */
		public void setAccount(String account) {
			this.account = account;
		}
		/**
		 * @return the broker
		 */
		public String getBroker() {
			return broker;
		}
		/**
		 * @param broker the broker to set
		 */
		public void setBroker(String broker) {
			this.broker = broker;
		}
		/**
		 * @return the setMonth
		 */
		public String getSetMonth() {
			return setMonth;
		}
		/**
		 * @param setMonth the setMonth to set
		 */
		public void setSetMonth(String setMonth) {
			this.setMonth = setMonth;
		}
		/* (non-Javadoc)
		 * @see java.lang.Object#toString()
		 */
		@Override
		public String toString() {
			StringBuilder builder = new StringBuilder();
			builder.append("GreekVerbSPk [account=");
			builder.append(account);
			builder.append(", broker=");
			builder.append(broker);
			builder.append(", setMonth=");
			builder.append(setMonth);
			builder.append("]");
			return builder.toString();
		}
		/* (non-Javadoc)
		 * @see java.lang.Object#hashCode()
		 */
		@Override
		public int hashCode() {
			final int prime = 31;
			int result = 1;
			result = prime * result
					+ ((account == null) ? 0 : account.hashCode());
			result = prime * result
					+ ((broker == null) ? 0 : broker.hashCode());
			result = prime * result
					+ ((setMonth == null) ? 0 : setMonth.hashCode());
			return result;
		}
		/* (non-Javadoc)
		 * @see java.lang.Object#equals(java.lang.Object)
		 */
		@Override
		public boolean equals(Object obj) {
			if (this == obj)
				return true;
			if (obj == null)
				return false;
			if (!(obj instanceof GreekVerbSPK))
				return false;
			GreekVerbSPK other = (GreekVerbSPK) obj;
			if (account == null) {
				if (other.account != null)
					return false;
			} else if (!account.equals(other.account))
				return false;
			if (broker == null) {
				if (other.broker != null)
					return false;
			} else if (!broker.equals(other.broker))
				return false;
			if (setMonth == null) {
				if (other.setMonth != null)
					return false;
			} else if (!setMonth.equals(other.setMonth))
				return false;
			return true;
		}
		
	}
	
}
